package com.lucene;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;

import java.io.StringReader;

/**
 * @Author : hebad90@163.com
 * @Date : 2015/3/17 15:07
 * @From : javalearn
 */
public class AnalyzerTest {
    public static void main(String[] args) throws Exception{
        String text ="we are good students";
        Analyzer analyzer = new StandardAnalyzer();

        analyze(analyzer, text);

    }
    public static void analyze(Analyzer analyzer,String text) throws Exception{
        System.out.println("-------------> 分词器：" + analyzer.getClass());
        TokenStream tokenStream = analyzer.tokenStream("content", new StringReader(text));


    }
}
